<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="0">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="../../css/public.css" media="all"/>
</head>
<body class="childrenBody">
<form class="layui-form">
    <table id="listTable1" lay-filter="list"></table>
</form>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script>
    layui.config({
        base: "../../js/"
    }).extend({
        "ajaxUrl": "ajax_config"
    });
    layui.use(['form', 'layer', 'laydate', 'table', 'laytpl', 'ajaxUrl'], function () {
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laytpl = layui.laytpl,
            table = layui.table;
        var ajaxArr = layui.ajaxUrl;

        //获取url中的参数
        function getUrlParam(name) {

            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg); //匹配目标参数
            if(r != null) return unescape(r[2]);
            return null; //返回参数值
        }
        var pageId = getUrlParam('id');

        var ajaxUrl = ajaxArr.getDirectMarketings.url+'?id='+pageId;
        var ajaxType = ajaxArr.getDirectMarketings.method;

        setTimeout(function () {
            //列表
            var tableIns1 = table.render({
                elem: '#listTable1',
                method: ajaxType,
                url: ajaxUrl,
                cellMinWidth: 95,
                page: true,
                height: "full-125",
                limit: 10,
                limits: [10, 15, 20, 25],
                id: "listTable1",
                response: {
                    statusCode: 200 //成功的状态码，默认：200
                },
                cols: [[
                    {field: 'LAY_TABLE_INDEX', title: '排序', width: 100,align: "center",templet:function (d) {
                            var num;
                            num = d.LAY_TABLE_INDEX+1;
                            return num;
                        }},
                    {field: 'id', title: 'ID', width: 50,align: "center"},
                    {field: 'avatar', title: '头像', minWidth: 100, align: "center",templet:function (d) {
                            var avatar ="";
                            if(d.avatar != "" && d.avatar != null){
                                avatar = '<img src="'+d.avatar+'" style="width: 30px;height: 30px" />';
                            }
                            return avatar;
                        }},
                    {field: 'nickname', title: '昵称', minWidth: 150, align: "center"},
                    {field: 'phone', title: '手机', minWidth: 150, align: "center"},
                    {field: 'level', title: '等级', minWidth: 150, align: "center",templet:function (d) {
                            var level = d.level,
                                levelName = "";
                            if(level !="" && level !=null){
                                levelName = level.name;
                            }
                            return levelName;
                        }},
                    {field: 'team_id', title: '团队的ID', minWidth: 100, align: "center"},
                    {field: 'recommend_man', title: '推荐人', minWidth: 100, align: "center"},
                    {field: 'status', title: '状态', minWidth: 100, align: "center",templet:function (d) {
                            var status;
                            if(d.status == 0){
                                status ='<span style="color: green">正常</span>'
                            }else{
                                status = '<span style="color: red">冻结</span>'
                            }

                            return status;
                        }},
                    {field: 'email', title: '邮箱', minWidth: 200, align: "center"},
                    {field: 'synthetic_card', title: '合成卡', minWidth: 200, align: "center"},
                    {field: 'invitation_code', title: '邀请码', minWidth: 200, align: "center"},
                    {field: 'integral', title: '积分', minWidth: 100, align: "center"},
                    {field: 'mine_pool', title: '聚宝盆资产', minWidth: 100, align: "center"},
                    {field: 'available_stone', title: '可用五行石', minWidth: 100, align: "center"},
                    {field: 'put_in_stone', title: '可投五行石', minWidth: 100, align: "center"},
                    {field: 'realname_verify_id', title: '实名认证ID', minWidth: 100, align: "center"},
                    {field: 'available_balance', title: '可用余额', minWidth: 100, align: "center"},
                    {field: 'used_balance', title: '已提余额', minWidth: 100, align: "center"},
                    {field: 'money', title: '钱包总收益', minWidth: 100, align: "center"},
                    {field: 'wechat_pay', title: '微信付款码', minWidth: 150, align: "center"},
                    {field: 'alipay', title: '支付宝付款码', minWidth: 150, align: "center"},
                    {field: 'created_at', title: '添加时间', width: 200, align: "center"}
                ]]
                ,
                done: function (res, curr, count) {
                    // console.log(res);
                }
            });
        },100)
    });
</script>
</body>
</html>